package com.qianli.cashmama.trade.dao.impl;
import com.fqgj.common.base.AbstractBaseMapper;
import com.qianli.cashmama.trade.dao.RiskMhReportContentDao;
import com.qianli.cashmama.trade.entity.RiskMhReportContentEntity;
import org.springframework.stereotype.Repository;

import java.util.HashMap;
import java.util.Map;

/**
* User: anonymous
* Date: 2021-11-04
* Time: 12:54:39.396
*/

@Repository
public class RiskMhReportContentDaoImpl extends AbstractBaseMapper<RiskMhReportContentEntity> implements RiskMhReportContentDao {



    @Override
    public RiskMhReportContentEntity selectOneByRiskNo(String riskNo) {
        Map<String, Object> map = new HashMap<>();
        map.put("riskNo", riskNo);

        return getSqlSession().selectOne(getStatement("selectOneByRiskNo"), map);
    }

    @Override
    public RiskMhReportContentEntity selectLatestOneByTradeNo(String tradeNo) {
        Map<String, Object> map = new HashMap<>();
        map.put("tradeNo", tradeNo);

        return getSqlSession().selectOne(getStatement("selectLatestOneByTradeNo"), map);
    }

    @Override
    public void updateReportByRiskNo(String riskNo, String reportUrl, String reportUrlNew) {
        Map<String, Object> map = new HashMap<>();
        map.put("riskNo", riskNo);
        map.put("reportUrl", reportUrl);
        map.put("reportUrlNew", reportUrlNew);

        getSqlSession().update(getStatement("updateReportByRiskNo"), map);
    }
}